#include "NewsManager.h"

#include <Assert.h>
#include <Store/NewsTable.h>
#include <Store/TempUploadsTable.h>

using namespace TCServer::Store;

namespace TCServer
{
	namespace Manager
	{
		NewsManager::NewsManager()
		{
		}

		NewsManager::~NewsManager()
		{
        }

        TCServer::Type::News NewsManager::query(quint64 id)
        {
            return NewsTable::query(id);
        }

		quint64 NewsManager::insert(const Type::News &news)
		{
            return NewsTable::insert(news);
		}

		void NewsManager::update(const Type::News &news)
		{
			return NewsTable::update(news);
		}

		void NewsManager::remove(quint64 id)
		{
			return NewsTable::remove(id);
		}

		QList<TCServer::Type::News> NewsManager::queryAll(quint64 groupId)
		{
			return NewsTable::queryAll(groupId);
		}

		TCServer::Manager::NewsManager* NewsManager::instance()
		{
			static auto _instance = new NewsManager;
			return _instance;
		}

	}
}

